#!/usr/bin/python
# -*-coding: UTF-8 -*-
"""
# Time: 2024/5/10 10:17
# @Author: 修养
# @Project_name: PROJECT_NAME
"""
# int 、 float 、 str、 boolan

#  Unit 1
# ~~~~~~~~~~~~~~数据类型 ~~~~~~~~~~~~~~
# int 类型
# a = 100
a = 300
# 字符 类型
# b = 'Hello World!'
# print(str(a))
# print(type(b))
# print("字符串长度：", len(b))
# c = b[0:5]
# print('字符串的切片：', c)
# c = b[1::2]
# print('字符串的切片：', c)
# print('返回Unicode编码为x的字符：', chr(97))
# print('返回字符x的Unicode编码值：', ord('A'))
b = 'Hello World!'
print(str(a))
print(type(b))
print("字符串的长度：", len(b))
c = b[0:5]
print('字符串的切片：', c)
c = b[1::2]
print('从字符串第二个字符开始，步长为2：', c)
c = b[::-1]
print("逆序输出字符串：", c)
c = b[-1]
print("倒数第一个字符：", c)

print("~~~~~~~~~~~~~字符串内包含引号~~~~~~~~~~~~~~~~")
# a = " '你好！'"
# print(a)
# a = ' "你好！" '
# print(a)
# a = ''' Hello Worlde! '''
# print(a)
# a = """
# Hello World!, 'Bob'
# """
# print(a)
a = "'你好！'"
print(a)
a = '''你好'''
print(a)
a = """
Hello World!, Bob
"""
print(a)

# 浮点 类型
# c = 3.14
# r = 12.56 / 3
# print('实数除法：', r)
# r = 12.56 // 3
# print('整除：', r)
# r = 12.56 % 3
# print("取余：", r)
c = 3.14
r = 12.56 / 3
print('求商：', r)  # 实数除法： 4.1866666666666665
r = 12.56 // 3
print("取整除，返回商的整数部分：", r)  # 整除： 4.0
r = 12.56 % 3
print("求余|取模：", r)  # 整除： 4.0

# 布尔 类型
# d = True
# e = False
# print(type(e))
d = True
e = False
print(type(e))

# 转义字符
# r = '\''  # 单引号
# r = '\n'  # 换行符
# r = '\t'  # 横向制表符
# r = '\r'  # 回车符
# print("退格符：", 'a', '\r', 'b')
r = '\''  # 单引号
r = '\n'  # 换行符
r = '\t'  # 横向制表符
r = '\r'  # 回车符
print("退格符：", 'a', '\r', 'b')

# Unit 2
# ~~~~~~~~~~~~~~四则运算 ~~~~~~~~~~~~~~
# x = 100
# y = 200
# z = x + y
# print(z)
# z = y/x
# print(z)
x = 100
y = 200
z = x + y
print(z)
z = y / x
print(z)
z = y // x
print(z)
z = y % x
print(z)